<?php

use Illuminate\Support\Facades\Log;
use Illuminate\Support\Facades\Redis;

Route::get("/amqp",function (){
    try {
        $out_trade_no="20240910170540691716933";
        $data = [
            "out_trade_no" => $out_trade_no,
            "type" => 1
        ];
        $redis = Redis::connection('amqpQueue');
        $redis->rPush("payListener",json_encode($data));
        Log::channel('amqp')->info("payListener:",$data);
        dd("ppppp");
    }catch (\Throwable $e){
        dump($e->getMessage());
        dump($e->getFile());
        dump($e->getLine());
    }

});
/*
|--------------------------------------------------------------------------
| Web Routes
|--------------------------------------------------------------------------
|
| Here is where you can register web routes for your application. These
| routes are loaded by the RouteServiceProvider within a group which
| contains the "web" middleware group. Now create something great!
|
*/

Route::get('/', function () {
//    return redirect('http://www.yunsoyi.com');
    return view('user.login');
});

Auth::routes();

Route::get('/home', 'HomeController@index')->name('home');


Route::group(['namespace' => 'AlipayOpen'], function () {
    Route::get('/alipay_oqr_create', 'AlipayCreateOrderController@alipay_oqr_create')->name('alipay_oqr_create');
});


//授权后跳转成功
Route::group(['namespace' => 'Merchant', 'prefix' => 'merchant'], function () {
    //跳转支付宝app
    Route::get('/appAlipay', 'MerchantController@appAlipay')->name('appAlipay');

});


//单页面
Route::group(['namespace' => 'Page', 'prefix' => 'page'], function () {

    Route::get('/success', 'PageController@success');
    Route::get('/pay_errors', 'PageController@pay_errors');
    Route::get('/pay_success', 'PageController@pay_success');
    Route::get('/cz_success', 'PageController@cz_success');


    //小程序添加员工
    Route::get('/add_merchant', 'PageController@add_merchant');


});


//二维
Route::group(['namespace' => 'Qr'], function () {
    //空码生成
    Route::get('/qr', 'QrController@qr')->name('qr');
    Route::get('/qr_code_hb', 'QrController@qr_code_hb')->name('qr_code_hb');
    //商户充值二维码
    Route::get('/merch_qr', 'QrController@merch_qr')->name('merch_qr');
    //渠道充值二维码
    Route::get('/user_qr', 'QrController@user_qr')->name('user_qr');
    Route::get('/store_list', 'QrController@store_list')->name('store_list');
});

//盒子
Route::group(['namespace' => 'Pay', 'prefix' => 'pay'], function () {
    //盒子支付
    Route::any('/print', 'PayController@print');
    Route::any('/authcode', 'PayController@authcode');
    Route::any('/queryorder', 'PayController@queryorder');
    Route::any('/mechanism_merchant', 'PayController@mechanism_merchant');
    Route::any('/get_company', 'PayController@get_company');
    Route::any('/get_stores', 'PayController@get_stores');
    Route::any('/nuonuo_accessToken', 'PayController@nuonuo_accessToken');
    Route::any('/get_invoice', 'PayController@get_invoice');
    Route::any('/test', 'PayController@test');
    Route::any('/day_stores', 'PayController@day_stores');
    Route::any('/day_Smooth', 'PayController@day_Smooth');
    Route::any('/store_cash_count', 'PayController@store_cash_count');
    Route::any('/wing_orders', 'PayController@wing_orders');
    Route::any('/get_wing_csv', 'PayController@get_wing_csv');
    Route::any('/order_query', 'PayController@order_query');
    Route::any('/yinkaUpdateToken', 'PayController@yinkaUpdateToken');
    Route::any('/bill', 'PayController@bill');
});

Route::group(['namespace' => 'QRTerminal', 'prefix' => 'QRTerminal'], function (){
    Route::any('merchBindQuery', 'IndexController@merchBindQuery');
    Route::any('authcodePay', 'IndexController@authcodePay');
    Route::any('queryPayState', 'IndexController@queryPayState');
    Route::any('transactionRecord', 'IndexController@transactionRecord');
    Route::any('transactionSummary', 'IndexController@transactionSummary');
    Route::any('merchBind', 'IndexController@merchBind');
    Route::any('authcodeRefund', 'IndexController@authcodeRefund');
    Route::any('authcodeRefundQuery', 'IndexController@authcodeRefundQuery');
    Route::any('store_verify_callback', 'IndexController@store_verify_callback');
    Route::any('pay_callback', 'IndexController@pay_callback');
    Route::any('test', 'IndexController@test');
});

Route::group(['namespace' => 'User', 'prefix' => 'user'], function () {
    Route::any('/openid', 'LoginController@openid');
});


